<template>
	<view>
		<view class="u-demo">
			<uni-rate @change="chang"></uni-rate>
			<uni-easyinput type="textarea" :value="value" v-model="value"></uni-easyinput>
			<button @click="tijiao">提交</button>
		</view>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				base: api.baseurl,
				shu: '',
				value: '',
				id: ''

			}
		},
		onLoad(options) {
			this.id = options.id
		},
		methods: {
			tijiao(id) {
				console.log(this.id)
				this.$post(this.base + '/prod-api/api/lawyer-consultation/legal-advice/evaluate', {
					"id": this.id,
					"evaluate": this.value,
					"score": this.shu
				}).then((res) => {
					if (res.code == 200) {
						uni.showToast({
							title: "提交成功",
						})
						
					} else {
						console.log(res.msg)
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				})
			},
			chang(e) {
				this.shu = e.value
			}
		}
	}
</script>

<style>

</style>
